﻿using NexC_Sharp.Services;
using System.Windows.Controls;

namespace RobotPerCeption.ViewModel
{
    public class SiFuStatusCtr
    {

        public static int STANDERBY = 1;// 1 就绪

        public static int SIFUSTOP = 0;//0 停止

        public static int RUING = 3;//3 运行态

        /// <summary>
        /// TCP连接后需要 更新当前伺服状态
        /// </summary>
        /// <param name="roboteName"></param>
        /// <param name="labstatus"></param>
        /// <param name="stopButton"></param>
        /// <param name="standByButton"></param>
        /// <param name="runingButtion"></param>
        public void tcpAfterInitSifu(string roboteName, Label labstatus, RadioButton stopButton, RadioButton standByButton, RadioButton runingButtion)
        {

            //0：停止状态 1：就绪状态 2：报警状态 3：运行状态
            int servo_result = Nex.get_servo_state(roboteName);
            if (servo_result == 0)
            {
                labstatus.Content = "停止状态";
                stopButton.IsChecked = true;

            }
            else if (servo_result == 1)
            {
                labstatus.Content = "就绪状态";
                standByButton.IsChecked = true;
            }
            else if (servo_result == 3)
            {
                labstatus.Content = "运行状态";
            }

        }




    }
}
